#include "MemoryAddress.h"


MemoryAddress::MemoryAddress( const address_t address_ )
{
	address = address_;
}

const std::string MemoryAddress::str() const
{
	std::ostringstream ostrm;
	ostrm << std::hex << std::uppercase << "0x" << address;
	return ostrm.str();
}

const std::wstring MemoryAddress::wstr() const
{
	std::wostringstream ostrm;
	ostrm << std::hex << std::uppercase << "0x" << address;
	return ostrm.str();
}

const MemoryAddress MemoryAddress::ptr( MemoryReader& reader, const address_t offset /*= 0*/ ) const
{
	address_t read;
	reader.read(address + offset, read);
	return read;
}

void MemoryAddress::set( address_t addr )
{
	address = addr;
}

const address_t MemoryAddress::value() const
{
	return address;
}

MemoryAddress::operator const address_t() const
{
	return address;
}
